<!DOCTYPE html>
<html>
	<head>
		<title>{$uinfo.user_login} - 个人中心</title>
		<meta name="keywords" content="" />
		<meta name="description" content="">
		<include file="public@head" />
		<style type="text/css">
			.table > tbody > tr > td:first-child{background:#f9f9f9;}
		</style>
	</head>
	<body class="body-white" id="top">
		<div class="container" style="margin-top:3rem;">
			<div class="row">
			<div class="panel panel-default">
				<div class="panel-heading text-right">
				    <input type="button" class="btn btn-primary" value="收银界面"  onclick="tiao()">
					<input type="button" class="btn btn-primary" onclick="PrintByPrinterIndex()" value="打印">
					<input type="button" class="btn btn-default" value="交接" onclick="jiaojie()">
				</div>
				<div class="panel-body">
					<div class="tabs">
						<div class="tab-content">
							<div class="tab-pane active" id="one">
								<div class="wrap js-check-wrap">								
										 <form class="form-horizontal group-border hover-stripped" action="{:url('Jiaojie/index')}">
										 	<table class="table table-hover table-bordered">
										 	<tbody>
											<tr >
												<td style="text-align: center;background-color: #dff0d8;">店铺</td>
												<td colspan="6">{:get_store_data($uinfo['store_id'],'store_name')}</td>
											</tr>
											<tr >
												<td style="text-align: center;background-color: #dff0d8;">操作员</td>
												<td colspan="6">{$uinfo.user_login}</td>
											</tr>
											<tr>
												<td style="text-align: center;background-color: #dff0d8;">上班时间</td>	
										        <td colspan="6">{$start}</td>
											</tr>
											<tr >
												<td style="text-align: center;background-color: #dff0d8;">下班时间</td>
												<td colspan="6">{$end}</td>
											</tr>
											
											<tr style="background-color: #dff0d8;text-align: center;">	
												<td style="text-align: center;background-color: #dff0d8;" rowspan="2">汇总</td>
												<td>会员卡支付</td>		
												<td>现金支付</td>	
												<td>积分支付</td>
												<td>微信支付</td>
												<td>支付宝</td>
												<td>外卖支付</td>
											</tr>
												<tr style="text-align: center;">
													<foreach name="list" item="vo">					
													<td>{$vo.total}</td>
													</foreach>
												</tr>
												<tr style="text-align: center;background-color: #dff0d8;">
												<td  rowspan="2" style="background-color: #dff0d8;">其他汇总</td>
												<td>总金额</td>
												<td>客流量</td>		
												<td colspan="2">人均消费</td>
												<td colspan="2">退款金额</td>
												</tr>
												<tr style="text-align: center;">
												<td>{$total_money}</td>
												<td>{$num}</td>		
												<td colspan="2">{$renjun}</td>
												<td colspan="2">{$tuikuan_money}</td>
												</tr>
												<tr style="text-align: center;background-color: #dff0d8;">
												<php>$num=count($supply)+1;</php>
												<td rowspan="{$num}" style="text-align: center;background-color: #dff0d8;">对冲</td>	
												<td colspan="2">对冲方式</td>		
												<td colspan="2">对冲金额</td>		
												<td colspan="3">备注</td>	
											    </tr>
											    <foreach name="supply" item="v">	
												<tr style="text-align: center;">
													<td colspan="2">{:get_pay_type_val($v['type'])}</td>
													<td colspan="2">{$v.money}</td>
													<td colspan="3">{$v.remark}</td>
												</tr>	
												</foreach>
										</tbody>
									</table>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			</div>
		</div>
		<!-- /container -->
		<include file="public@scripts" />
    	<script src="__STATIC__/js/wind.js"></script>
		<script src="__TMPL__/public/assets/dayin/LodopFuncs.js"></script>
		<script type="text/javascript">
		function tiao(){
			window.location.href='{:url("Home/Menu/menu")}';
		}
		function jiaojie(){
			window.location.href='{:cmf_url("user/Login/logout")}';
		}
		</script>
	</body>
</html>
<script>
   var LODOP; //声明为全局变量
   //ajax接收数据
   var shugo;
   $.ajax({
      async:false,//异步设置为同步
      type:"POST",
      url:"/home/Print/jiaojie",
      success:function(date){
          shugo = JSON.parse(date.msg);
      }
   });
   //获取打印机
   var pdate = [];
   $.ajax({
       async:false,
       type:"POST",
       url:"/home/Print/printname",
       success:function(dayinj){
           pdate = JSON.parse(dayinj.msg);
       }
   });
   function PrintByPrinterIndex(){
       CreatePrintPage();
       if (LODOP.SET_PRINTER_INDEX(pdate.print_namejj))
           LODOP.PRINT();
   }
   //获取商品统计
   var goodsnum = [];
   $.ajax({
       async:false,
       type:"POST",
       url:"/home/Print/jiaojieone",
       success:function(date){
           goodsnum = JSON.parse(date.msg); 
       }
   });
   function CreatePrintPage(){
       var length = goodsnum.length;
       LODOP=getLodop(); 
       LODOP.ADD_PRINT_TEXT(40,65,90,40,"交接单");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",16);
       LODOP.ADD_PRINT_TEXT(65,20,345,31,"店铺:"+shugo.店铺);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",10);
       LODOP.ADD_PRINT_TEXT(80,20,345,31,"交班人:"+shugo.交班人);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(95,20,345,31,"手机号:"+shugo.手机号);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(110,20,345,31,"上班时间:"+shugo.上班时间);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(125,20,345,31,"下班时间:"+shugo.下班时间);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_LINE(138,2,138,185,0,1);
       LODOP.ADD_PRINT_TEXT(141,65,100,40,"付款统计");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
       LODOP.ADD_PRINT_TEXT(158,14,345,31,"会员卡:"+shugo.会员卡支付);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(158,110,345,31,"现金:"+shugo.现金支付);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(174,14,345,31,"积分:"+shugo.积分支付);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(174,110,345,31,"微信:"+shugo.微信支付);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(190,14,345,31,"支付宝:"+shugo.支付宝);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(190,110,345,31,"外卖:"+shugo.外卖支付);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_LINE(205,2,205,185,0,1);
       LODOP.ADD_PRINT_TEXT(210,65,100,40,"其他统计");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
       LODOP.ADD_PRINT_TEXT(230,14,345,31,"总金额:"+shugo.总金额);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(230,110,345,31,"退款金额:"+shugo.退款金额);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(245,14,345,31,"客流量:"+shugo.客流量);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_TEXT(245,110,345,31,"人均消费:"+shugo.人均消费);
       LODOP.SET_PRINT_STYLEA(0,"FontSize",8);
       LODOP.ADD_PRINT_LINE(258,2,258,185,0,1);
       LODOP.ADD_PRINT_TEXT(265,57,100,40,"商品销售统计");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",11); 
       LODOP.ADD_PRINT_TEXT(283,25,345,31,"总金额");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
       LODOP.ADD_PRINT_TEXT(283,85,345,31,"数量");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
       LODOP.ADD_PRINT_TEXT(283,130,345,31,"金额");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
       bianli();
       LODOP.ADD_PRINT_TEXT(320+(18*length),14,345,31,"交接人:");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
       LODOP.ADD_PRINT_TEXT(320+(18*length),115,345,31,"店长:");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
       LODOP.ADD_PRINT_TEXT(360+(18*length),45,345,31,"同志们辛苦了!");
       LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
       LODOP.SET_LICENSES("","4154EF517CB1509D9291CA6610B5CF0B","C94CEE276DB2187AE6B65D56B3FC2848","");
       LODOP.SET_PRINT_PAGESIZE(3,500,45,"");//这里3表示纵向打印且纸高“按内容的高度”；500表示纸宽500mm；45表示页底空白4.5mm
   };
   function bianli(){
       var iCurLine=298;
       for(i=0;i<goodsnum.length;i++){
           LODOP.ADD_PRINT_TEXT(iCurLine,18,345,31,goodsnum[i].classify_name);
           LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
           LODOP.ADD_PRINT_TEXT(iCurLine,100,345,31,goodsnum[i].zhongnum);
           LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
           LODOP.ADD_PRINT_TEXT(iCurLine,135,345,31,goodsnum[i].zhongmoney);
           LODOP.SET_PRINT_STYLEA(0,"FontSize",9);
           iCurLine = iCurLine+18;
       }
   }
</script>

